package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._02策略模式._1基本代码;

/**
 * @ClassName Test
 * @Description TODO
 * @Author zero
 * @DATE 2023/7/9 11:25 PM
 * @Version 1.0
 */
public class Test {
    public static void main(String[] args) {
        Context context;

        //由于实例化不同的策略，所以最终在调用
        //context.contextInterface()时,所
        //获得的结果就不尽相同
        context = new Context(new ConcreteStrategyA());
        context.contextInterface();

        context = new Context(new ConcreteStrategyB());
        context.contextInterface();

        context = new Context(new ConcreteStrategyC());
        context.contextInterface();

    }
}
